export const uuid = function():string {
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
        let r = Math.random() * 16 | 0,
            v = c == 'x' ? r : (r & 0x3 | 0x8);
        return v.toString(16);
    });
}

export const hideRightMenu = function(){
    document.addEventListener(
        "contextmenu",
        function(e){
            e.preventDefault()
        }
    )
}

export const gettime = function(){
    let date = new Date();
    let y  =date.getFullYear();
    let m = date.getMonth()+1;
    let d = date.getDate(); 
    let h = date.getHours();
    let min = date.getMinutes();
    let s = date.getSeconds();
    return y+'-'+m+'-'+d+' '+h+':'+min+':'+s;
}

// 禁止文本选择
export const forbidSelect = function(){
    document.addEventListener("selectstart", function (e) {
        e.preventDefault();
    });
}